package com.central.test

import com.central.service.{DayNightService, NightCondition}
import com.central.utils.ConfigUtil
import org.apache.spark.sql.SparkSession

object TestNight {
  def main(args: Array[String]): Unit = {
    val condition = NightCondition(132, "2354515123151451", "imsi")
    val sparksession = SparkSession
      .builder()
      .appName("testRecord")
      .master("local")
      .config("es.nodes", ConfigUtil.properties.getProperty("elasticsearch.host", "192.168.5.180"))
      .config("es.port", ConfigUtil.properties.getProperty("elasticsearch.port", "9200"))
      .config("es.mapping.date.rich", "false")

      .getOrCreate()
    sparksession.sparkContext.setLogLevel("error")
    new DayNightService()
      .dayNightAnalysis(sparksession, condition)
  }
}
